/*
 * @Author: your name
 * @Date: 2021-10-20 22:20:10
 * @LastEditTime: 2021-10-21 19:12:34
 * @LastEditors: Please set LastEditors
 * @Description: 最长上升子序列
 * @FilePath: \luogu\动态规划\模板问题\P1020 导弹拦截\up.cpp
 */

#include<iostream>
#include<algorithm>
using namespace std;

//f[i] 前i个数字以a[i]结尾的最长上升序列
int f[100];

int a[100];

int main(){
    int n;
    cin >> n;
    for(int i=1; i<=n; i++){
        cin >> a[i];
        //最起码有1 本身
        f[i] = 1;
        for(int j=1; j<=i-1; j++){
            if(a[i] > a[j]){
                f[i] = max(f[i],f[j]+1);
            }
        }
    }
    int res = 0;
    for(int i=1; i<=n; i++){
        res = f[i] > res ? f[i] : res;
    }
    cout << res << endl;
    return 0;
}

